import {LengthOfVector2D} from "./LengthOfVector2D";
import {Vector2} from "./Direction2D";

let AngleOfTwoVectorsInRad2D = (d1:Vector2, d2:Vector2) => {
    let dot = d1[0] * d2[0] + d1[1] * d2[1];
    let d1Length = LengthOfVector2D(d1);
    let d2Length = LengthOfVector2D(d2);
    return Math.acos(dot / (d1Length * d2Length));
};

export {AngleOfTwoVectorsInRad2D};